<?php

namespace app\common\model\jooj_member;

/**
 * Description of FamilysTies
 *
 * @author Expect
 */
class FamilysTies extends Base {

    protected $base_table = 'jj_family_ties';
    protected $table = 'jj_family_ties';
    protected $connection = ['database' => 'jooj_member'];

    /**
     * 初始化方法
     * @param type $companyId
     */
    public function __construct($companyId = []) {
        if (!is_array($companyId)) {
            $this->table = $this->base_table . '_' . $companyId;
        }
        parent::__construct($companyId);
    }

    /**
     * 获取一条记录
     * @param type $condition
     * @param type $field
     * @return type
     */
    public function getOneByCondition($condition, $field = '*') {
        return $this->field($field)->where($condition)->find();
    }

    /**
     * 
     * @param type $where
     * @param type $page
     * @param type $pageSize
     * @param string $field
     * @return type
     */
    public function getPageListByCondition($where, $page, $pageSize, $field = '*', $order = 'desc') {
        return $this->getPageCount($where, $page, $pageSize, $field = "*", $order);
    }

}
